home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / ANSI Headers / new < prev    next >
Encoding:
Text File  |  1995-04-14  |  1.6 KB  |  74 lines  |  [TEXT/MMCC]

  1. // new standard header
  2. #if !__MWERKS__
  3.  
  4. #ifndef _NEW_
  5. #define _NEW_
  6. #include <exception>
  7.         // class xalloc
  8. class xalloc : public xruntime {
  9. public:
  10.     xalloc(const char * = 0, const char * = 0,
  11.         const char * = 0);
  12.     virtual ~xalloc();
  13. protected:
  14.     virtual void do_raise();
  15.     };
  16.         // function and object declarations
  17. fvoid_t *set_new_handler(fvoid_t *);
  18. void operator delete(void *);
  19. void *operator new(size_t);
  20. inline void *operator new(size_t, void *_P)
  21.     {return (_P); }
  22. #if _HAS_ARRAY_NEW
  23. void operator delete[](void *);
  24. void *operator new[](size_t);
  25. inline void *operator new[](size_t, void *_P)
  26.     {return (_P); }
  27. #endif
  28. extern fvoid_t (*_New_hand);
  29. #endif
  30.  
  31. #else /* __MWERKS__ */
  32.  
  33. #ifndef __NEW__
  34. #define __NEW__
  35.  
  36. #ifndef __STDDEF__
  37. #include <stddef.h>
  38. #endif
  39.  
  40. #include <exception>
  41.         // class xalloc
  42. class xalloc : public xruntime {
  43. public:
  44.     xalloc(const char * = 0, const char * = 0,
  45.         const char * = 0);
  46.     virtual ~xalloc();
  47.     };
  48.  
  49. void operator delete(void *);
  50. void *operator new(size_t);
  51. inline void *operator new(size_t, void *_P)
  52.     {return (_P); }
  53. void (*set_new_handler (void (*) ())) ();
  54. //extern void (*set_new_handler (void (*) ())) ();
  55. //extern void *operator new(size_t size,void *p);
  56.  
  57. //    non-standard functions
  58. extern void _set_newpoolsize(size_t);        //    default: 0x00010000L
  59. extern void _set_newnonptrmax(size_t);        //    default: 0x00001000L
  60. extern char _prealloc_newpool(size_t);        //    preallocte a new buffer
  61.  
  62. #endif
  63.  
  64. #endif /* __MWERKS__ */
  65. /*
  66.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  67.  * Consult your license regarding permissions and restrictions.
  68.  */
  69.  
  70. /* Change log:
  71.  *94June04 PlumHall baseline
  72.  *94Oct07 Inserted MW changes.
  73.  */
  74.